Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-intercom-native: dynamically reduce conversation_parts window size #2439

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

Alex-Bair
Copy link
Member

@Alex-Bair Alex-Bair commented Feb 24, 2025

Description:

In conversation_parts, we attempt to only yield parts that have been updated since the previous sweep. Because of this, we can only checkpoint after checking a full date window. If a date window contains a large number of updated conversations, it can take conversation_parts more than one day to check all those conversations for updated parts. This has been observed for at least one task; about 4,000 pages of conversations were updated within 1 day (the smallest configurable date window).

This commit adds some dynamic reduction logic to size of the date window conversation_parts checks in a single fetch_conversation_parts invocation. If there are more than 25 pages of conversations, then the date window is split in half until there are <= 25 pages or the date window is the smallest possible size (1 second).

An alternative approach would be to yield all parts of an updated conversation, then conversation_parts can checkpoint after each page of conversations. I chose to do dynamic window reduction since that's keeps the connector's current behavior of only yielding updated parts, but this alternative approach could be worth while later if the date window approach is too slow & we aren't extremely concerned about yielding duplicate, non-updated parts.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

Tested on a local stack. Confirmed the date window for a single invocation of fetch_conversation_parts is reduced until there are <= 25 pages of conversations or the date window is the smallest possible size of 1 second.


This change is Reviewable

…a reasonable size

In `conversation_parts`, we attempt to only yield parts that have been
updated since the previous sweep. Because of this, we can only
checkpoint after checking a full date window. If a date window contains
a large number of updated conversations, it can take `conversation_parts`
more than one day to check all those conversations for updated parts.
This has been observed for at least one task; about 4,000 pages of
conversations were updated within 1 day (the smallest configurable date
window).

This commit adds some dynamic reduction logic to size of the date window
`conversation_parts` checks in a single `fetch_conversation_parts`
invocation. If there are more than 25 pages of conversations, then the
date window is split in half.
…nd `tickets`

After the change in commit 7702e44 to checkpoint after every page, the counts in `conversations` and `tickets` no longer served any purpose. I missed removing them in that earlier commit, so they're being removed now.
@Alex-Bair Alex-Bair marked this pull request as ready for review February 24, 2025 14:41
Copy link
Member

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alex-Bair Alex-Bair merged commit 77b4cd3 into main Feb 24, 2025
80 of 87 checks passed
@Alex-Bair Alex-Bair deleted the bair/source-intercom-native-reduce-window-size branch February 24, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants